<?php

$this->_toolbar = array(
	'title'		=>	Yii::t('admin_news', 'Ads Manager'),
	'buttons'	=>	array(
			CHtml::link(Yii::t('app','Delete'), "", array("id"=>"delete", "class"=>"button-s del", "onclick"=>"deleteAll('".Yii::app()->createUrl('/admin_ads/ads/delMulti')."','".Yii::t('app','Are you sure you want to delete item?')."')")),
			CHtml::link(Yii::t('app','Advanced Search'), "",array("id"=>"search", "class"=>"search-button button-s")),
		)
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('news-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('ext.widgets.iGridView', array(
	'id' => 'ads-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
		'id',
		'name',
		'client_id',
		'ordering',
		'clicks',
		'params',
		/*
		'click_url',
		'created_time',
		*/
		array(
			'class' => 'CButtonColumn',
		),
	),
)); ?>